<template>
  <div>
    <h1>$nextTick的基本使用</h1>
    <p ref="hh">{{msg}}</p>
    <button @click="changeMsg">改msg</button>
  </div>
</template>

<script>
export default {
    data(){
      return {
        msg:'你好世界'
      }
    },
    methods:{
      changeMsg() {
        //修改完msg 后
        this.msg='HelloWord'
        this.$nextTick(() => {
            console.log(this.$refs.hh.innerHTML);
        })
        
      }
    }
};
</script>

<style >

</style>